<!-- 导航栏下拉菜单 -->
<template>
  <button class="movzhankai" @click="asidedata.dit()">
    <el-icon>
      <Menu />
    </el-icon>
  </button>
  <Breadcue class="mbzujia"></Breadcue>
  <div class="yip">
   <div><img src="https://img.zcool.cn/community/01bdab577b6aa70000012e7ee9bd01.gif" style="height:100%;"></div>
  </div>
  <el-dropdown class="me" >
    <span class="el-dropdown-link">
      <div class="tupic">
        <img :src="loginuser.pic">
      </div>
      <div>{{ loginuser.zcname }}</div>
    </span>
    <template #dropdown>
      <el-dropdown-menu>
        <el-dropdown-item @click="selfbit()">个人中心</el-dropdown-item>
        <el-dropdown-item @click="backdit()">切换账户</el-dropdown-item>
      </el-dropdown-menu>
    </template>
  </el-dropdown>
</template>

<script setup lang='js'>
import { ref, reactive } from 'vue'
import { navdata } from "@/stores/index.js";
import Breadcue from '@/components/breadcur.vue';
import { loguser } from "@/stores/loginuserdata.js";
import { useRouter } from "vue-router";
const router = useRouter()
const loginuser = loguser()
const asidedata = navdata();
const backdit = ()=>{
  localStorage.removeItem('loguser')
  window.location.replace('http://localhost:5173/login')

}
const selfbit = ()=>{
  router.replace('/manner/userself')
}

</script>

<style  scoped>
.me {
  width: 100px;
  height: 4vh;
  top: 1vh;
  right: 10px;
  position: absolute;
}

.mbzujia {
  margin-left: 5vw;
  line-height: 6vh;
}

.movzhankai {
  position: absolute;
  height: 6vh;
  width: 69px;
  font-size: 24px;
  line-height: 6vh;
  top: 0px;
  left: 0px;
}
.el-dropdown-link{
  line-height: 4vh;
  font-size: 18px;
  color: aliceblue;
}
.el-dropdown-link div{
  float: left;
  cursor: pointer;
}
.tupic{
  width: 4vh;
  height: 4vh;
  overflow: hidden;
  border-radius: 50%;
  display: inline-block;
  margin-right: 3px;
}
.tupic img{
  width: 100%;
  height: 100%;
}
.yip{
  position: absolute;
  top: 0;
  left: 50%;
  transform: translate(-50%);
  height: 6vh;
  width: 50vw;
  display: flex;
  justify-content: space-around;
}
.yip div{
  width: 6vh;
  height: 6vh;
}
</style>
